package com.group6.controller;

import com.group6.entity.Admission;
import com.group6.entity.Department;
import com.group6.service.DepartmentService;
import com.group6.vo.DepartmentVo;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("/Department")
public class DepartmentController {

    @Resource
    private DepartmentService departmentService;

    @RequestMapping("/DepartmentList")
    public List<Department> DepartmentList(){

        return  departmentService.DepartmentList();
    }
    @RequestMapping("/DepartmentAdd")
    public String DepartmenList(@RequestBody DepartmentVo departmentVo){

        return  departmentService.DepartmentAdd(departmentVo);
    }
    @RequestMapping("/DepartmentUpdate")
    public String DepartmenUpdate(@RequestBody Department department){

        return  departmentService.DepartmentnUpdate(department);
    }
    @RequestMapping("/DepartmentDelete")
    public String admissionDelete(@RequestBody Admission admission){

        return  departmentService.departmentDelete(admission);
    }
}


